from Base.Base import Base
import time


def test_connection():
    base = Base()
    print("尝试连接数据库...")
    start = time.time()

    conn = base.connect_db()
    if conn:
        print(f"连接成功！耗时 {time.time() - start:.2f} 秒")
        conn.close()
    else:
        print("连接失败")


if __name__ == '__main__':
    test_connection()